#include "Utf16Array.h"

namespace lhcutils
{

Utf16Array::Utf16Array(QString str) : m_qStringToKeepAlive(str)
{
	;
}

const boost::uint16_t* Utf16Array::CodePointPtr() const
{
	return m_qStringToKeepAlive.utf16();
}

#ifdef _WIN32
const wchar_t* Utf16Array::WcharPtr() const
{
	return reinterpret_cast<const wchar_t*>(m_qStringToKeepAlive.utf16());
}
#endif

const boost::uint8_t* Utf16Array::BytePtr() const
{
	return reinterpret_cast<const boost::uint8_t*>(m_qStringToKeepAlive.utf16());
}

std::size_t Utf16Array::CodePointCount() const
{
	return m_qStringToKeepAlive.size();
}

std::size_t Utf16Array::ByteCount() const
{
	return m_qStringToKeepAlive.size() * 2;
}

}

/*
 Copyright 2011 Greg Najda

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
